package com.swh.service.Impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.swh.dao.QualificationDao;
import com.swh.entity.Qualification;
import com.swh.entity.QualificationCondition;
import com.swh.service.QualificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * @Author: swh
 * @Description:
 * @Date: 2020/12/14 14:46
 * @Version: 1.0
 */
@Service
public class QualificationServiceImpl extends BaseServiceImpl<Qualification> implements QualificationService {

    @Autowired
    public QualificationServiceImpl(QualificationDao dao) {
        super(dao);
    }

    @Autowired
    private QualificationDao qualificationDao;


    @Override
    public PageInfo<HashMap> selectPage(Integer pageNum, Integer pageSize, QualificationCondition condition) {
        PageHelper.startPage(pageNum,pageSize);
        List<HashMap> list = qualificationDao.selectPage((pageNum -1) * pageSize, pageSize, condition);
        return new PageInfo<>(list);
    }

    //    审核通过
    @Override
    public int updateById(Qualification appVersion) {
        return qualificationDao.updateById(appVersion);
    }

    //    审核失败
    @Override
    public int updateById2(Qualification appVersion) {
        return qualificationDao.updateById2(appVersion);
    }
}
